package patterns.absfactory;

/**
 * Created by lenovo on 2016/11/22 0022.
 * 对外提供shape图像的工厂
 */
public class ShapeFactory extends AbstractFactory{

    @Override
    IShape getShape(String shapeType) {
        if (shapeType == null){
            return null;
        }
        if (shapeType.equalsIgnoreCase("Rect")){
            return new Rectangle();
        }else if (shapeType.equalsIgnoreCase("Circle")){
            return  new Circle();
        }else if (shapeType.equalsIgnoreCase("Square")){
            return new Square();
        }
        return null;
    }
    //此工厂只用于提供图形，所以getColor()不做具体实现。
    @Override
    IColor getColor(String colorType) {
        return null;
    }
}
